package com.bestcem.xm.deliver.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bestcem.xm.component.mybatis.base.BaseEntity2;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * @author SXS
 * @TableName ds_deliver_deliver
 */
@TableName(value = "ds_deliver_deliver")
@Data
@EqualsAndHashCode(callSuper = true)
public class DeliverDeliver extends BaseEntity2 {
    @TableId(value = "id")
    private String id;

    /**
     * 组织ID
     */
    @TableField(value = "org_id")
    @JsonProperty("orgID")
    private String orgId;

    /**
     * 编号
     */
    @TableField(value = "code")
    private String code;

    /**
     * 名称
     */
    @TableField(value = "name")
    private String name;

    /**
     * 推送类型
     */
    @TableField(value = "ttype")
    private Integer ttype;

    /**
     * 状态
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * 渠道
     */
    @TableField(value = "channel")
    private Integer channel;

    /**
     * 场景
     */
    @TableField(value = "scenes")
    private Integer scenes;

    /**
     * 投放链接是否生效，为False生效，为True失效
     */
    @TableField(value = "disable")
    private Integer disable;

    /**
     * 描述
     */
    @TableField(value = "reason")
    private String reason;

    /**
     * 投放开始时间
     */
    @TableField(value = "starttime")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime starttime;

    /**
     * 投放结束时间
     */
    @TableField(value = "finishtime")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime finishtime;

    /**
     * 防打扰投放时间段设置
     */
    @TableField(value = "delay_time")
    @JsonProperty("delay_time")
    @JSONField(name = "delay_time")
    private String delayTime;

    /**
     * delay_failed_ttype
     */
    @TableField(value = "delay_failed_ttype")
    @JsonProperty("delay_failed_ttype")
    @JSONField(name = "delay_failed_ttype")
    private Integer delayFailedTtype;

    /**
     * 防打扰后继续投放时间
     */
    @TableField(value = "delay_failed_time")
    @JsonProperty("delay_failed_time")
    @JSONField(name = "delay_failed_time")
    private String delayFailedTime;

    /**
     * 添加奖励状态
     */
    @TableField(value = "award_use_type")
    @JsonProperty("award_use_type")
    @JSONField(name = "award_use_type")
    private Integer awardUseType;

    /**
     * 奖励id
     */
    @TableField(value = "award_id")
    @JsonProperty("award_id")
    @JSONField(name = "award_id")
    private String awardId;

    /**
     * 是否可以答题。True 可以答题， False 不可以答题
     */
    @TableField(value = "enable_respondent")
    @JsonProperty("enable_respondent")
    @JSONField(name = "enable_respondent")
    private Integer enableRespondent;

    /**
     * 具体投放时间
     */
    @TableField(value = "deliver_time")
    @JsonProperty("deliver_time")
    private LocalDateTime deliverTime;

    /**
     * 使用时间戳（微秒级）保存修改的版本，异步任务开始时会校验时间戳，版本更新，直接退出任务
     */
    @TableField(value = "version")
    private Long version;
}